package com.newer.realm;

import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;

import org.apache.shiro.web.filter.authc.FormAuthenticationFilter;
import org.apache.shiro.web.util.WebUtils;
/**
 * 配置登陆成功后跳转的URL  这里还需要在spring-shiro配置文件中配置
 * @author ZhangZihan
 *
 */
public class LoginFormAuthenticationFilter extends FormAuthenticationFilter {

	// 制定登陆成功后跳转url
	private final String successUrl = "/pages/index";

	@Override
	protected void issueSuccessRedirect(ServletRequest request, ServletResponse response) throws Exception {
		WebUtils.issueRedirect(request, response, successUrl, null, true);
	}
}
